package com.leyou.order.client;

import com.leyou.order.dto.AddressDTO;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Rose
 * @Date: 2021/4/13 12:02
 * @description ${description}
 * @version: 1.0.0
 */
public abstract class AddressClient {

    public static final List<AddressDTO> addressList = new ArrayList<AddressDTO>() {
        AddressDTO address1 = new AddressDTO(1L, "虎哥", "17699673095", "新疆", "乌鲁木齐", "新市区", "大寨沟物资大院 4号楼3单元", "31310301030", false);
        AddressDTO address2 = new AddressDTO(2L, "张哥", "17699673093", "北京", "北京", "朝阳区", "天堂路 3号楼", "31310301030", false);
        AddressDTO address3 = new AddressDTO(3L, "李哥", "17699673094", "上海", "上海", "浦东新区", "航头镇航头路18号传智博客 3号楼", "31310301030", false);
    };

    public static AddressDTO findById(Long id) {
        for (AddressDTO addressDTO : addressList) {
            if (addressDTO.getId().equals(id)) {
                return addressDTO;
            }
        }
        return null;
    }
}
